﻿using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace SystemSettings
{
    public class Setting
    {
        /// <summary>
        /// 获取所有优盘
        /// 查找根目录下所有Harddisk开头的盘符
        /// </summary>
        /// <returns></returns>
        public static List<string> GetUsbDisks()
        {
            var disks = Directory.GetDirectories(@"\");
            return disks.Where(disk => disk.ToLower().StartsWith("\\harddisk") && !string.Equals(disk.ToLower(), "\\harddisk")).ToList();
        }
    }
}
